package comits.business.tiers.dao;

import org.hibernate.SQLQuery;
import org.hibernate.context.internal.ManagedSessionContext;

import comits.business.tiers.orm.hibernate.HibernateSession;

public class TauxServiceDAOImpl implements TauxServiceDAO {
	public Double getCoefTaux(int taux){
		SQLQuery sql =  HibernateSession.currentSession()
		.createSQLQuery(PropertiesConfig.Get("selectcoef"));
	//	SQLQuery sql =  HibernateSession.currentSession().createSQLQuery(" select * from tauxservice where taux=? ");
		sql.setInteger(0, taux);
		
		Double coef =(Double)  sql.uniqueResult();
		ManagedSessionContext.unbind(HibernateSession.getSessionFactory());
		return coef;
		
	}

}
